<route lang="json5" type="page">
{
  style: {
    navigationBarTitleText: '通知详情',
  },
}
</route>

<template>
    <view class="box">
        <view class="title">{{ obj.title }}</view>
        <view class="time">{{ obj.created_at }}</view>
        <view class="content" v-html="obj.content"></view>
    </view>
</template>

<script lang="ts" setup>
import { filter } from '@/utils'
import { http } from '@/utils/http'

const obj = ref<any>({
    id: '',
    title: '',
    content: '',
    created_at: '',
})
onLoad((options) => {
    if (options.id) {
        obj.value.id = parseInt(options.id)
        http.get('/member/user/user_notice', { id: obj.value.id }).then((res: any) => {
            if (res.code == 200) {
                filter(res.data, obj.value)
            }
        })
        http.put('/member/user/user_notice_me', { id: obj.value.id, type: "read_user_id" })
    }
})

</script>

<style scoped>
.box {
    padding: 20rpx;
    background: white;
}

.title {
    font-size: 32rpx;
    font-weight: bold;
    text-align: center;
}

.time {
    margin: 20rpx 0;
    font-size: 28rpx;
    text-align: center;
}

.content {
    font-size: 28rpx;
    color: #333;
}
</style>